package com.cyys.modules.system.controller.param;

import com.cyys.modules.core.controller.BaseAction;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/sys/paramHoliday")
public class ParamHolidayAction extends BaseAction {
//
//	@Resource
//	private ParamHolidayService paramHolidayService;
//
//	@RequestMapping("/add/input")
//	@RequiresPermissions(value = {"sys:paramHoliday:add", "sys:paramHoliday:edit"},logical=Logical.OR)
//	public String input(ParamHoliday paramHoliday, Model model)  {
//		model.addAttribute("holidayTypeMap", ParamBasicUtil.getParamBasicTypeMap().get(ParamConstants.HOLIDAY_TYPE));
//		if (paramHoliday != null && paramHoliday.getHolidayDate() != null) {
//			ParamHoliday p = paramHolidayService.getByDate(paramHoliday.getHolidayDate());
//			if(p == null)
//				model.addAttribute("paramHoliday", paramHoliday);
//			else
//				model.addAttribute("paramHoliday", p);
//		}
//		return "module/system/param/paramHoliday-input";
//	}
//
//	@RequestMapping("/list")
//	@RequiresPermissions("sys:paramHoliday:list")
//	public String list(Model model)  {
//
//		return "module/system/param/paramHoliday-list";
//	}
//
//	@ResponseBody
//	@RequestMapping("/list/listInfo")
//	@RequiresPermissions("sys:paramHoliday:list")
//	@SystemLog(module = "系统参数", methods = "节假日管理-查询节假日")
//	public AjaxJson listInfo(ParamHoliday paramHoliday, Model model)  {
//		AjaxJson aj = new AjaxJson();
//
//		if(paramHoliday == null || paramHoliday.getHolidayYear() == null){
//			paramHoliday.setHolidayYear(DateUtil.DateToString(new Date(), "yyyy"));
//		}
//		List<ParamHoliday> paramHolidayList = paramHolidayService.listAll(paramHoliday, 0);
//		String returnList = "{";
//		for (int i=0;i<paramHolidayList.size();i++) {
//			ParamHoliday p = paramHolidayList.get(i);
//			returnList += "'" + p.getHolidayDate() + "':'" + p.getHolidayTypeName() + "'";
//			if(i != paramHolidayList.size() -1){
//				returnList += ",";
//			}
//		}
//		returnList +="}";
//		aj.setSuccess(true);
//		aj.setMsg("获取成功");
//		aj.put("year", Integer.valueOf(paramHoliday.getHolidayYear()));
//		aj.put("mark", returnList);
//		return aj;
//	}
//
//	@ResponseBody
//	@RequestMapping("/add/save")
//	@RequiresPermissions(value = {"sys:paramHoliday:add", "sys:paramHoliday:edit"},logical=Logical.OR)
//	@SystemLog(module = "系统参数", methods = "节假日管理-保存节假日")
//	public AjaxJson save(ParamHoliday paramHoliday, Model model)  {
//		AjaxJson aj = paramHolidayService.save(paramHoliday);
//		aj.setMsg("设置成功");
//		return aj;
//	}
//
//	@ResponseBody
//	@RequestMapping("/del/deleteByDate")
//	@RequiresPermissions("sys:paramHoliday:del")
//	@SystemLog(module = "系统参数", methods = "节假日管理-删除节假日")
//	public AjaxJson deleteById(String date)  {
//		return paramHolidayService.physicsDeleteByDate(date);
//	}
//
//	@ResponseBody
//	@RequestMapping("/add/createHolidayForYear")
//	@RequiresPermissions(value = {"sys:paramHoliday:add", "sys:paramHoliday:edit"},logical=Logical.OR)
//	@SystemLog(module = "系统参数", methods = "节假日管理-创建年度周末日期")
//	public AjaxJson createHolidayForYear(String year) {
//		return paramHolidayService.createHolidayForYear(year);
//	}

}
